import requests
import json
import cv2
import numpy as np
import shutil

addr = 'http://localhost:5000'
test_url = addr + '/api/test'

# prepare headers for http request
content_type = 'multipart/form-data'
headers = {}
# send http request with image and receive response
response = requests.post(test_url, data={"url":"https://ailib.s3.cn-northwest-1.amazonaws.com.cn/wx02bc18d5fde937ac.o6zAJs3n4fxAFg5JU6I6yI_7TkTM.HPaXbK8UnIIt011dcff71dfa6c45d3d95e48e454abdb.jpg"}, headers=headers)
# decode response
with open("server.jpg", 'wb') as f:
    for chunk in response:
        f.write(chunk)